package com.util.baidu;

import net.sf.json.JSONObject;
import org.apache.commons.collections.map.HashedMap;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by reeveslee on 16/5/14.
 */
public class MsgModelIOS extends HashMap {
    private String alertStr;
    Map<String, Object> aps;

    public MsgModelIOS() {
        super();
        alertStr = "";
        aps = new HashedMap();
        aps.put("alert", alertStr);
        aps.put("sound","default");
        super.put("aps", aps);
    }

    public void setAlertStr(String alertStr) {
        this.alertStr = alertStr;
        aps.replace("alert", alertStr);
    }

    public String toJsonString() {
        return JSONObject.fromObject(this).toString();
    }
}
